package com.hyt.it.ogt.ks.login.model;

import lombok.Getter;

import java.util.Objects;

/**
 * @author wuyingge
 * @version 1.0.0
 * @ClassName LoginTypeEnum.java
 * @Description 考生登录类型
 * @createTime 2022年10月25日 10:44:00
 */
@Getter
public enum LoginTypeEnum {

    ID_CARD_LOGIN(1, "身份证"),
    PHONE_LOGIN(2, "手机号"),
    ADMISSION_NUM_LOGIN(3, "准考证");

    private Integer code;
    private String msg;

    LoginTypeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsg(Integer code){
        if(Objects.isNull(code)){
            return ": ";
        }
        for (LoginTypeEnum type : LoginTypeEnum.values()){
            if(Objects.equals(type.getCode(),code)){
                return type.getMsg() + ": ";
            }
        }
        return ": ";
    }

}
